import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import { query2obj, generate } from '@feidao/core/querystring';

export default async function a002(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	// 列表查询
	// 获取输入框的内容
	const v = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id="search_name"]').value;
	if (v.trim()) {
		// 设置查询条件
		const query = fd.data.params;
		const q = (query.param || (query.param = {}));
		q['exam_name'] = { $regex: '.*' + v + '.*', $options: 'i' };
		window.location.href = generate(query);
	}
}
